<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>后台登陆 - Powered By 暂停的故事（www.betou.net）</title>
<meta name="Author" content="暂停的故事 叶装装" />
<meta name="Copyright" content="暂停的故事" />
<#include "/betou_sys/head.html"/>
<script type="text/javascript">
$().ready( function() {
	<#if errors??>
	<#list errors as error>
		$.dialog({type: "warn", content: '${error}', modal: true, autoCloseTime: 3000});
	</#list>
	</#if>
	var $loginForm = $("#loginForm");
	var $username = $("#username");
	var $password = $("#password");
	var $captcha = $("#captcha");
	var $captchaImage = $("#captchaImage");
	var $isRememberUsername = $("#isRememberUsername");

	// 判断"记住用户名"功能是否默认选中,并自动填充登录用户名
	if(getCookie("adminUsername") != null) {
		$isRememberUsername.attr("checked", true);
		$username.val(getCookie("adminUsername"));
		$password.focus();
	} else {
		$isRememberUsername.attr("checked", false);
		$username.focus();
	}

	// 提交表单验证,记住登录用户名
	$loginForm.submit( function() {
		if ($username.val() == "") {
			$.dialog({type: "warn", content: "请输入您的用户名!", modal: true, autoCloseTime: 3000});
			return false;
		}
		if ($password.val() == "") {
			$.dialog({type: "warn", content: "请输入您的密码!", modal: true, autoCloseTime: 3000});
			return false;
		}
		
		if ($isRememberUsername.attr("checked") == true) {
			var expires = new Date();
			expires.setTime(expires.getTime() + 1000 * 60 * 60 * 24 * 7);
			setCookie("adminUsername", $username.val(), expires);
		} else {
			removeCookie("adminUsername");
		}

		$('#loginTips').html('正在登录,请稍后...');
		
	});

});



</script>
</head>
<body class="login">
	<script type="text/javascript">
		// 登录页面若在框架内，则跳出框架
		if (self != top) {
			top.location = self.location;
		};
	</script>
	<div class="blank"></div>
	<div class="blank"></div>
	<div class="blank"></div>
	<div class="body">
		<form id="loginForm" action="login.do" method="post">
		<#if returnUrl??><input type="hidden" name="returnUrl" value="${returnUrl}"/></#if>
		<#if processUrl??><input type="hidden" name="processUrl" value="${processUrl}"/></#if>
            <table class="loginTable">
            	<tr>
            		<td rowspan="3"><img src="${base}/res/betou/images/logo2.png" alt="暂停的故事管理中心" /></td>
                    <th  style="text-align: left"><@s.m "login.username"/>:</th>
					<td><input type="text" id="username" name="username"   class="formText"/></td>
                </tr>
                <tr>
					<th style="text-align: left">
						<@s.m "login.password"/>:
					</th>
                    <td>
                    	<input type="password" id="password" name="password" class="formText" />
                    </td>
                </tr>
                <#if errorRemaining?? && errorRemaining<=0>
                <tr>
                	<th style="text-align: left">
                		<@s.m "login.captcha"/>:
                	</th>
                    <td>
                    	<input name="captcha" type="text" id="captcha"  class="formText captcha"/>
                   		<img class="captchaImage" src="${base}/captcha.svl" onclick="this.src='${base}/captcha.svl?d='+new Date()*1" alt="换一张" />
                    </td>
                </tr>
                </#if>
                <tr>
                <#if errorRemaining?? && errorRemaining<=0>
                <td>
                		&nbsp;
                </td>
                </#if>
                
                	<th>
                		&nbsp;
                	</th>
                    <td>
                    	<label>
                    		<input type="checkbox" id="isRememberUsername" />&nbsp;记住用户名
                    	</label>
                    </td>
                </tr>
                <tr>
                	<td>
                		&nbsp;
                	</td>
                	<th>
                		&nbsp;
                	</th>
                    <td>
                        <input type="button" class="homeButton" value="" onclick="window.open('/')" hidefocus /><input type="submit" class="submitButton" value="登 录" hidefocus />
                        <span id="loginTips"></span>
                    </td>
                </tr>
            </table>
            <div class="powered">
            	COPYRIGHT © 2013 BETOU.NET ALL RIGHTS RESERVED.
            </div>
            <div class="link">
            	<a href="/">前台首页</a> |
				<a href="http://www.betou.net">官方网站</a> |
				<a href="http://www.betou.net/about.jhtml">关于我们</a> |
				<a href="http://www.betou.net/about.jhtml">联系我们</a> 
            </div>
        </form>
	</div>
</body>
<#include "/common/alert_message.html"/>
</html>